home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
vbinst13
/
vbwarn.frm
< prev
next >
Wrap
Text File
|
1995-12-05
|
4KB
|
143 lines
VERSION 2.00
Begin Form Warn
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Overwrite Warning!"
ClientHeight = 1230
ClientLeft = 1335
ClientTop = 4605
ClientWidth = 7020
ControlBox = 0 'False
Height = 1635
Left = 1275
LinkMode = 1 'Source
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 1230
ScaleWidth = 7020
Top = 4260
Width = 7140
Begin CommandButton Cmd_Warn
Cancel = -1 'True
Caption = "&Cancel"
Height = 375
Index = 3
Left = 5400
TabIndex = 1
Top = 720
Width = 1335
End
Begin CommandButton Cmd_Warn
Caption = "&No"
Default = -1 'True
Height = 375
Index = 2
Left = 3960
TabIndex = 0
Top = 720
Width = 1335
End
Begin CommandButton Cmd_Warn
Caption = "Yes to &All"
Height = 375
Index = 1
Left = 2520
TabIndex = 2
Top = 720
Width = 1335
End
Begin CommandButton Cmd_Warn
Caption = "&Yes"
Height = 375
Index = 0
Left = 1080
TabIndex = 3
Top = 720
Width = 1335
End
Begin PictureBox Picture1
AutoSize = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 0 'None
ForeColor = &H00000000&
Height = 480
Left = 240
Picture = VBWARN.FRX:0000
ScaleHeight = 480
ScaleWidth = 480
TabIndex = 5
Top = 360
Width = 480
End
Begin Label Lbl_Warn
BackColor = &H00C0C0C0&
Height = 495
Left = 1080
TabIndex = 4
Top = 120
Width = 5655
End
End
Sub Cmd_Warn_Click (Index As Integer)
Select Case (Index)
Case 0 'Overwrite the file
Warn.Hide
install.Refresh
install.Lbl_List.Caption = "Now copying file " + FileStr$
FileCopy Source$, Dest$
install.List1.AddItem Dest$
Case 1
Warn.Hide 'Set WarnFlag to False so overwrite
install.Refresh
install.Lbl_List.Caption = "Now copying file " + FileStr$
FileCopy Source$, Dest$
install.List1.AddItem Dest$
WarnFlag = False 'warning is no longer displayed
Case 2 ' no over writing
Warn.Hide
Case 3 'Cancel install
Warn.Hide
Msg$ = "Are you sure you want to cancel install?" 'give the user a second change
Title$ = "CANCEL???"
Response% = MsgBox(Msg$, 292, Title$) ' Get user response. '36+4+256
If Response% = IDYES Then ' Evaluate response
install.Hide
Msg$ = "Installation aborted"
Title$ = "Install"
MsgBox Msg$, 64, Title$
End
Else
install.Lbl_List.Caption = "Now copying file " + FileStr$
FileCopy Source$, Dest$
install.List1.AddItem Dest$
Exit Sub
End If
End Select
End Sub
Sub Cmd_Warn_KeyPress (Index As Integer, KeyAscii As Integer)
'do command if user press key equivalent to button
Select Case KeyAscii
Case Asc("y"), Asc("Y")
Cmd_Warn_Click (0)
Case Asc("a"), Asc("A")
Cmd_Warn_Click (1)
Case Asc("n"), Asc("N")
Cmd_Warn_Click (2)
Case Asc("c"), Asc("C")
Cmd_Warn_Click (3)
End Select
End Sub
Sub Form_Load ()
' Center on the screen
'
Move (Screen.Width - Width) \ 2, (Screen.Height - Height) \ 2
Screen.MousePointer = 0 'default
End Sub